package myschool.cycleadvanced.homework;

import java.util.Scanner;

public class StudentsParticipating {
    /**
     * 若有3个班级各4名学院参赛，
     * 计算每个班级参赛学院平均分，
     * 统计成绩大于85分学员人数
     */
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int[][] score = new int[3][4];
        for (int i = 0; i < 3; i++) {
        System.out.println("请输入第"+(i+1)+"个班级的成绩");
                    double avg = 0;
            for (int j = 0; j < 4; j++) {
                System.out.println("第"+(j+1)+"个学员的成绩：");
                score[i][j] = input.nextInt();
                    avg = avg+score[i][j];
                if(j == 3){
                System.out.println("第"+(i+1)+"个班级参赛学院的平均分是："+avg/(j+1));
                }
            }
        }
            int number = 0;
        for (int i = 0; i <3 ; i++) {
            for (int j = 0; j <4 ; j++) {
                if(score[i][j] <= 85){
                    continue;
                }else{
                    number++;
                }
            }
        }
                System.out.println("成绩85分以上的学员人数有："+number+"人");
    }
}
